//
//  VCPhotoLookViewController.m
//  VideoCollage
//
//  Created by Mac on 2018/6/25.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import "VCPhotoLookViewController.h"

@interface VCPhotoLookViewController ()
@property(nonatomic, strong) UIImageView                     *imageView;/**< <##> */
@end

@implementation VCPhotoLookViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"Photo Look";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, TMUtils.tabBarTop - TMUtils.navgationBarBootom + 49)];
    self.imageView.image = self.model.cachedImage;
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    if (self.model) {
        [[TZImageManager manager] getOriginalPhotoWithAsset:self.model.asset completion:^(UIImage *photo, NSDictionary *info) {
            if (![info[PHImageResultIsDegradedKey] boolValue]) {
                //原图
                self.imageView.image = photo;
            }
        }];
    }else{
        if (self.forceImage) {
             self.imageView.image = self.forceImage;
        }
        if (self.imagePath) {
            self.imageView.image = [UIImage imageWithContentsOfFile:self.imagePath];
        }
    }

    self.tableView.tableHeaderView = self.imageView;
}

@end
